# 管理员接口
from db import db_handler


# 修改额度
def change_balance_interface(username, input_money):
    user_dic = db_handler.select(username)
    if not user_dic:
        return False, '用户不存在'
    user_dic['balance'] = input_money
    db_handler.save(user_dic)
    return True, '额度修改成功'

# 锁定用户
def lock_user(username):
    user_dic = db_handler.select(username)
    if not user_dic:
        return False, '用户不存在'
    user_dic['locked'] = True
    db_handler.save(user_dic)
    return True, '用户锁定成功'
